export const urlStringify = (url, payload, encode = true) => {
  const arr = Object.keys(payload).map(
    (key) =>
      `${key}=${encode ? encodeURIComponent(payload[key]) : payload[key]}`
  );

  return arr.length ? `${url}?${arr.join("&")}` : url;
};
